package exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始");
        try {
            String str = "5456";

            System.out.println(str.length());
        }catch (NullPointerException e){
            System.out.println("出现了空指针,并在这里得以解决");

        }catch(Exception e){
            System.out.println("未知错误");
        }
        System.out.println("程序结束");


    }
}
